package com.situ.mall.service.Impl;

import com.situ.mall.mapper.CategoryMapper;
import com.situ.mall.pojo.entity.Category;
import com.situ.mall.pojo.vo.CategoryVO;
import com.situ.mall.service.ICategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements ICategoryService {
    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public List<Category> listAll() {
        return categoryMapper.listAll();
    }

    @Override
    public List<Category> ByCategoryPatientId(Integer id) {
        return categoryMapper.ByCategoryPatientId(id);
    }

    @Override
    public List<CategoryVO> listAlls() {
        return categoryMapper.listAlls();
    }

    @Override
    public List<Category> listChild(Integer parentId) {
        return categoryMapper.listChild(parentId);
    }

    @Override
    public Category categoryName(Integer parentId) {
        return categoryMapper.selectByPrimaryKey(parentId);
    }
}
